package com.jine.boot.core;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

@WebFilter(filterName="myFilter",urlPatterns="/*")
public class MyFilter implements Filter {
    Logger logger = LoggerFactory.getLogger(MyFilter.class);

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        logger.info(">>>>>>>>>>>MyFilter>init>>>>>>>>>>>>>>>>");
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
        logger.info(">>>>>>>>>>>MyFilter>doFilter>>>>>>>>>>>>>>>>");
        filterChain.doFilter(request,response);
    }

    @Override
    public void destroy() {
        logger.info(">>>>>>>>>>>MyFilter>destroy>>>>>>>>>>>>>>>>");
    }
}
